<?php

namespace Home\Controller;

use Think\Controller;
use \Model\EntityModel;
use \Model\SkillShareModel;


class AppointmentController extends Controller {
//    订单确认
    function indent($skill_id){
	//判断用户是否登录，若已经登录则，展示用户个人中心，若没登录，则展示用户登录界面
	if (isset($_SESSION["user"])) {
	    $user_account = $_SESSION["user"];
//	    dump($user_account);
	} else {
	    $this->redirect('User/login');
	}
	
	
	$skill = D('skill_share');
	 $sql = "SELECT 
	   
		skill_id,
		user_address0,
		user_nickname,
		user_sex,
		user_tel,
		
		skill_title,
		skill_img_name_small0,
		skill_price

		FROM
		wx_skill_share,wx_user,wx_user_address

		WHERE "."skill_id = $skill_id and ".
		"wx_skill_share.skill_user = wx_user.user_account and wx_user.user_account = wx_user_address.user_account
		;";
//	dump($sql);
//	exit;
        $info = $skill -> query($sql);
	//	exit;

	//计算总价
	$info[0]["skill_total"] = $info[0]["skill_price"];
//	dump($info);
//	exit;
	

	
	
	
//	$info = D('skill_share') -> find($skill_id);
	
	
	
	$this ->assign('info', $info[0]);
	
	
//	dump($info); 
	$this->display();
	
	
	
    }
}